import  Vue from 'vue'
import axios from 'axios'
const s =  axios.create({
  baseURL: 'http://127.0.0.1:8888/api/private/v1/'
})

s.interceptors.request.use(config => {
  // console.log(window,sessionStorage.getItem('token'))
  if (window.sessionStorage.getItem('token') !== null) {
    // console.log('-----------------------')
    config.headers.Authorization = window.sessionStorage.getItem('token')
  }
  return config
})

s.interceptors.request.use(response => {
  // console.log(response.data.token)
  return response
})

export default s
